<?php
namespace app\model;

/*
 * 用户地址模型.
 */
class OrderAddress extends \think\Model
{
    protected $table = 'order_address'; // 表名

    protected $type = [
        'dist_id' => 'integer',
    ];
    protected $field = ['order_id', 'name', 'mobile', 'address', 'dist_id', 'postcode'];          // 允许写入字段
    public function getAddressAttr($value, $data)
    {
        return City::labels($data['dist_id'], ['value' => 'code', 'label' => 'name']) . $value;
    }
}
